<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0">
    <title>Title</title>
    <style>
        .box {
            width: 300px;
            height: 300px;
            background: lightblue;
        }
    </style>
</head>
<body>
<div class="box" id="box"></div>

<script type="module">
  const box = document.querySelector('#box')
  import Touch2 from "./index.js"

  const touch = new Touch2(box)
  const gesture = [
    'rotate', // 旋转
    'pinch', // 捏合
    'tap', // 单机
    'doubletap', // 双击
    'press', // 按压
    'pan', // 拖拽
    'swipe', // 快速划过
  ]

  gesture.forEach(item => {
    touch.on(item, (data) => {
      console.log(data)
    })
  })
</script>
</body>
</html>
